home *** CD-ROM | disk | FTP | other *** search
- on echo
- !****************************************************************************!
- ! !
- ! Data Revision and Conversion in SORITEC !
- ! (Section 2.6 and Section 6.4) !
- ! !
- !****************************************************************************!
- !
- ! Data may be revised or their periodicities may be converted by SORITEC
- ! Sampler by a simple set of commands. In general, data revision
- ! requires you to enter a sequence of two commands:
- ! (1) Set the USE period to the period that you want the
- ! data to be revised, and
- ! (2) Update the data explicitly with the REVISE command or
- ! implicitly through a transformation expression with
- ! the ON REVISE global option enabled.
- ! Conversion of periodicities is enabled in SORITEC Sampler by the
- ! CONVERT command. All options associated with this command, which
- ! identify how conversion is to be accomplished and the output variable
- ! name are entered directly into the command line. The important thing
- ! to remember here is that CONVERT converts the data series into the
- ! periodicity associated with the currently active USE command. You
- ! need not specify the periodicity of the input series as SORITEC
- ! Sampler can detect it.
- !
- ! The examples shown here demonstrate the fundamentals of data revision
- ! and conversion, but do not illustrate all possible applications of the
- ! commands. Additional examples of data revision are given in the
- ! SORITEC Sampler documentation.
- !
- !****************************************************************************!
- ! !
- ! Data Revision !
- ! (Section 2.6) !
- ! !
- !****************************************************************************!
- !
- ! This example uses estimates of real Gross National Product (GNP)
- ! expressed in billions of 1972 dollars to demonstrate how data revision
- ! is done in SORITEC. Read in the data for two separate periods. Note
- ! that the data are quarterly.
- !
- USE 1976q1 1979q4
- READ gnp72_pre1980
- 1285.000000 1293.700000 1301.100000 1313.100000
- 1341.300000 1363.300000 1385.800000 1388.400000
- 1400.000000 1437.000000 1448.800000 1468.400000
- 1472.600000 1469.200000 1486.600000 1489.300000
- ;
- USE 1980q1 1984q4
- READ gnp72
- 1496.400000 1461.400000 1464.200000 1477.900000
- 1513.500000 1511.700000 1522.100000 1501.300000
- 1483.500000 1480.500000 1477.100000 1478.800000
- 1491.000000 1524.800000 1550.200000 1572.700000
- 1610.900000 1638.800000 1645.200000 1661.100000
- ;
- END
-
- !
- ! Copy gnp72 into another variable to compare with revised data
- !
-
- gnp72_old = gnp72
-
- !
- ! Assume that fourth quarter GNP has been revised from the 3.9 percent
- ! growth currently implied by the fourth quarter estimate to 5 percent.
- ! This is accomplished in a straight-forward manner with the REVISE
- ! command. First, enter the growth rate into SORITEC Sampler using the
- ! SET command.
- !
-
- SET growth_rate = 1.05
-
- !
- ! Second, change the USE period to the time period over which
- ! you want to revise the data. In this case, it is simply 1984Q4.
- !
-
- USE 1984q4
-
- !
- ! The only thing to remember in this example is that real growth is
- ! expressed in annual terms and when estimating GNP from quarter to
- ! quarter, it must first be converted to a quarter to quarter growth
- ! rate. This can be done directly within the REVISE command, i.e.,
- !
-
- REVISE gnp72 = gnp72(-1) * growth_rate ** .25
-
- !
- ! Compare the revised and original time series by printing the last
- ! four quarters, 1984q1 to 1984q4.
- !
-
- USE 1984q1 1984q4
- PRINT gnp72_old gnp72
-
- !
- ! Data can be revised implicitly in transformations if the REVISE
- ! global option is set with the ON REVISE command. This is
- ! demonstrated in an example which spices forecasts of GNP over
- ! the four quarters of 1985 to our recently revised GNP data.
- !
- ! A Business Week article, "Why Factories Aren't Running at Full
- ! Stream", Business Week, February 18, 1985, p. 118 estimates
- ! annual percentage GNP growth for the four quarters of 1985 will
- ! be the following:
- !
- ! Quarter Annual Growth Rate(%)
- ! ------- ---------------------
- ! 1985q1 2.6
- ! 1985q2 2.7
- ! 1985q3 2.5
- ! 1985q4 2.3
- !
- ! We'll enter these numbers into SORITEC Sampler with the FILL command.
- !
-
- USE 1985q1 1985q4
- FILL growth 1.026 1.027 1.025 1.023
-
- !
- ! Now enable data revision global option with the ON REVISE command.
- ! When this option is enabled, any transformation of an existing variable
- ! changes only the active observations, as defined by the currently active
- ! USE period. Observations outside the active observation range are
- ! retained. If ON REVISE is not set, observations outside the active
- ! USE period are lost.
- !
-
- ON REVISE
-
- !
- ! Simply specify GNP for each quarter of 1985 as a transformation based
- ! upon the previous quarter's estimate to revise the GNP time series to
- ! include 1985 values. Remember to convert annual growth rates to
- ! quarterly growth rates in the transformation line. Note that we
- ! must enable the DYNAMIC global option to cause the transformation
- ! to substitute lagged variables into the equation as it calculates
- ! the forecast values.
- !
-
- ON DYNAMIC
-
- gnp72 = gnp72(-1) * growth ** 0.25
-
- OFF DYNAMIC
-
- !
- ! Don't worry about the error message. SORITEC Sampler
- ! dynamically extends the series, anyway.
- !
- ! Print out the revised series for 1984 and 1985.
- !
-
- USE 1984q1 1985q4
- PRINT gnp72
-
- !
- ! Remember to disable the REVISE option after you are satisfied with
- ! the results.
- !
-
- OFF REVISE
-
- !
- ! Splicing data series together is just as easy. Let's say we want
- ! to splice our pre-1980 GNP time series to our GNP time series that
- ! runs from 1980q1 to 1985q4. Using the explicit REVISE command, we
- ! simply define the USE period over which the data are to be revised,
- ! i.e.,
- !
-
- USE 1976q1 1979q4
-
- !
- ! and then REVISE the data.
- !
-
- REVISE gnp72 = gnp72_pre1980
-
- !
- ! Print out the entire series to examine the results.
- !
-
- USE 1976q1 1985q4
- PRINT gnp72
-
- !
- ! If you wanted to use the ON REVISE option to splice the two series
- ! together, the command sequence would be:
- !
-
- USE 1976q1 1979q4
- ON REVISE
- gnp72 = gnp72_pre1980
- OFF REVISE
- cls
-
- !****************************************************************************!
- ! !
- ! Data Conversion !
- ! (Section 6.4) !
- ! !
- !****************************************************************************!
- !
- ! Periodicity conversion is demonstrated by an example where we wish to
- ! examine the relationship between real GNP, the federal budget deficit
- ! and total population. Our data consist of "gnp72", which is a quarterly
- ! time series, "federal_deficit", which is monthly, and "annual_population"
- ! which is an annual time series. We will change all data series to
- ! quarterly data to enable an equation to be estimated. We will not
- ! estimate the equation in this example, however. Estimation techniques
- ! are demonstrated in the "REGRESS.SAC" command file.
- !
- ! First, read in budget deficit and population data.
- !
-
- USE 1980m1 1984m12
- READ federal_deficit
- -4.448000000 -9.285000000 -13.10800000 9.751000000
- -14.03700000 12.36800000 -14.99300000 -6.956000000
- 5.640000000 -16.92100000 -8.907000000 -1.965000000
- -12.19200000 -15.62000000 -9.582000000 17.19000000
- -16.17100000 15.36300000 -10.34300000 -5.119000000
- 6.335000000 -18.10500000 -10.64200000 -19.46800000
- 9.339000000 -14.78000000 -18.25500000 9.704000000
- -18.93000000 6.724000000 -19.83100000 -14.70400000
- -1.708000000 -26.16900000 -24.15800000 -17.93800000
- -9.582000000 -25.33600000 -26.03600000 -3.308000000
- -29.28500000 3.401000000 -21.41200000 -17.47700000
- 1.946000000 -25.06900000 -21.59100000 -16.66100000
- -5.515000000 -20.38100000 -28.55500000 11.49300000
- -33.93200000 -2.000000000 -16.41600000 -33.49800000
- 16.78500000 -28.78700000 -28.46200000 MISSING
- ;
- USE 1979 1984
- READ annual_population
- 225055.0000 227738.0000 230019.0000 232309.0000
- 234496.0000 MISSING
- ;
- END
-
- !
- ! Just for practice, we'll update the two series through 1984.
- !
- ! (1) federal_deficit
- !
-
- USE 1984m12
- REVISE federal_deficit = -15.179
-
- !
- ! (2) annual_population
- !
-
- USE 1984
- REVISE annual_population = 236634
-
- !
- ! Now convert monthly federal deficit estimates to annual data.
- !
- ! First, change the USE period to the periodicity to which you
- ! want the data converted, in this case, quarterly.
- !
-
- USE 1980q1 1984q4
-
- !
- ! Second, convert the data using the CONVERT command. There are
- ! 5 different options available for converting data from higher to lower
- ! frequencies: SUM the observations; AVERAGE the observations; use the
- ! MINimun observation in each period; use the MAXimum observation in each
- ! period; or use the LAST observation in each period. The choice depends
- ! upon the way the series is defined and on how the converted time series
- ! is to be applied. In our example, it is appropriate to SUM the
- ! observations to quarterly periodicity, since federal deficit estimates
- ! are expressed as the total deficit incurred in each month. Since SUM
- ! is the default option, the modifier may be omitted from the command
- ! line.
- !
-
- CONVERT quarterly_fed_deficit = federal_deficit
-
- !
- ! Conversion from annual to quarterly data follows the same
- ! procedures except that the modifiers are different. When
- ! converting from a lower to higher periodicity, you can
- ! FILL each subperiod in the converted series with the value
- ! associated with the entire period, or SHARE the data
- ! equally among all subperiods. In this case, neither modifier
- ! seems appropriate because FILL produces the same population
- ! estimates for each quarter of the year while SHARE clearly
- ! generates incorrect results - since quarterly populations are
- ! not simply annual population divided by 4! We can reasonably
- ! good results if we CONVERT using the SHARE modifier and
- ! then take a moving sum of length 4 over the periods t-2 to t+1.
- ! Since SHARE is the default, it can be omitted from the command
- ! line.
- !
-
- USE 1979q1 1984q4
- CONVERT temp_population = annual_population
-
- !
- ! Now calculate the moving sum over the specified period using
- ! the MSUM command.
- !
- ! Since the period over which the moving sum is to be taken ranges
- ! from t-2 to t+1, change the active observation period accordingly.
- !
- USE 1979q2 1984q3
-
- MSUM quarterly_population temp_population(+1) 4
-
- !
- ! We'll extrapolate that value from the annual growth rate
- ! in population from 1983 to 1984 after adjusting it to a
- ! quarterly growth rate.
- !
- ! Calculate the growth rate.
- !
-
- USE 1984
- SET growth_rate = (annual_population/annual_population(-1))**0.25
-
- !
- ! Extrapolate the quarterly estimate to 1984q4.
- !
-
- USE 1984q4
- REVISE quarterly_population = quarterly_population(-1) * growth_rate
-
- !
- ! Compare the quarterly population estimates with estimates
- ! generated by the CONVERT command when the FILL modifier is
- ! used.
- !
-
- USE 1980q1 1984q4
- CONVERT (FILL) temp_population = annual_population
- PRINT temp_population quarterly_population
-
- !
- ! Now print out the three quarterly series for the 1980q1 to
- ! 1984q4 period.
- !
-
- PRINT gnp72 quarterly_fed_deficit quarterly_population
-
- !
- ! That's it!
- !
- QUIT
-
-
-
-